<template>
  <div class="top">
    <van-nav-bar

        left-text="返回"
        left-arrow
        @click-left="onClickLeft"
    />
    <img :src="url" alt="" style="width: 100vw;object-fit: cover">

  </div>

</template>

<script setup>
import {useRouter,useRoute} from "vue-router";
import {inject,onMounted,ref} from "vue";
const router = useRouter();
const route = useRoute();
const id = route.path.split('/')[2];
const axios = inject("axios")
const onClickLeft = () => {
  router.back()
}
const url = ref("")
onMounted(()=>{
  axios.get(`swiper/id?id=${id}`).then(res=>{
    url.value = res.data.data.content
  })
})

</script>

<style scoped>
.top {
  width: 100vw;
  margin: 0 auto;
}
</style>